home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / FontSync.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  8.2 KB  |  296 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        FontSync.h
  3.  
  4.      Contains:    Public interface for FontSync
  5.  
  6.      Version:    Technology:    Mac OS 9
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __FONTSYNC__
  18. #define __FONTSYNC__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __FILES__
  25.     #include <Files.h>
  26. #endif
  27.  
  28. #ifndef __FONTS__
  29.     #include <Fonts.h>
  30. #endif
  31.  
  32. #ifndef __SFNTTYPES__
  33.     #include <SFNTTypes.h>
  34. #endif
  35.  
  36. #ifndef __MACERRORS__
  37.     #include <MacErrors.h>
  38. #endif
  39.  
  40.  
  41.  
  42.  
  43. #if PRAGMA_ONCE
  44. #pragma once
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. #if PRAGMA_IMPORT
  52. #pragma import on
  53. #endif
  54.  
  55. #if PRAGMA_STRUCT_ALIGN
  56.     #pragma options align=power
  57. #elif PRAGMA_STRUCT_PACKPUSH
  58.     #pragma pack(push, 2)
  59. #elif PRAGMA_STRUCT_PACK
  60.     #pragma pack(2)
  61. #endif
  62.  
  63.  
  64. /* Matching Options */
  65.  
  66. typedef UInt32 FNSMatchOptions;
  67. enum {
  68.     kFNSMatchNames                = 0x00000001,                    /* font names must match */
  69.     kFNSMatchTechnology            = 0x00000002,                    /* scaler technology must match */
  70.     kFNSMatchGlyphs                = 0x00000004,                    /* glyph data must match */
  71.     kFNSMatchEncodings            = 0x00000008,                    /* cmaps must match */
  72.     kFNSMatchQDMetrics            = 0x00000010,                    /* QuickDraw Text metrics must match */
  73.     kFNSMatchATSUMetrics        = 0x00000020,                    /* ATSUI metrics (incl. vertical) must match */
  74.     kFNSMatchKerning            = 0x00000040,                    /* kerning data must match */
  75.     kFNSMatchWSLayout            = 0x00000080,                    /* WorldScript layout tables must match */
  76.     kFNSMatchAATLayout            = 0x00000100,                    /* AAT (incl. OpenType) layout tables must match */
  77.     kFNSMatchPrintEncoding        = 0x00000200,                    /* PostScript font and glyph names and re-encoding vector must match */
  78.     kFNSMissingDataNoMatch        = 0x80000000,                    /* treat missing data as mismatch */
  79.     kFNSMatchAll                = 0xFFFFFFFF,                    /* everything must match */
  80.     kFNSMatchDefaults            = 0                                /* use global default match options */
  81. };
  82.  
  83. EXTERN_API_C( FNSMatchOptions )
  84. FNSMatchDefaultsGet                (void);
  85.  
  86.  
  87. /* Version control */
  88.  
  89. typedef UInt32 FNSObjectVersion;
  90. enum {
  91.     kFNSVersionDontCare            = 0,
  92.     kFNSCurSysInfoVersion        = 1
  93. };
  94.  
  95. /* No features defined yet.*/
  96. typedef UInt32                             FNSFeatureFlags;
  97. /*
  98.    The FontSync library version number is binary-coded decimal:
  99.    8 bits of major version, 4 minor version and 4 bits revision.
  100. */
  101.  
  102. struct FNSSysInfo {
  103.     FNSObjectVersion                 iSysInfoVersion;            /* fill this in before calling FNSSysInfoGet*/
  104.     FNSFeatureFlags                 oFeatures;
  105.     FNSObjectVersion                 oCurRefVersion;
  106.     FNSObjectVersion                 oMinRefVersion;
  107.     FNSObjectVersion                 oCurProfileVersion;
  108.     FNSObjectVersion                 oMinProfileVersion;
  109.     UInt16                             oFontSyncVersion;
  110. };
  111. typedef struct FNSSysInfo                FNSSysInfo;
  112. EXTERN_API_C( void )
  113. FNSSysInfoGet                    (FNSSysInfo *            ioInfo);
  114.  
  115.  
  116. /* FontSync References */
  117. typedef struct OpaqueFNSFontReference*     FNSFontReference;
  118. EXTERN_API_C( OSStatus )
  119. FNSReferenceGetVersion            (FNSFontReference         iReference,
  120.                                  FNSObjectVersion *        oVersion);
  121.  
  122. EXTERN_API_C( OSStatus )
  123. FNSReferenceDispose                (FNSFontReference         iReference);
  124.  
  125. EXTERN_API_C( OSStatus )
  126. FNSReferenceMatch                (FNSFontReference         iReference1,
  127.                                  FNSFontReference         iReference2,
  128.                                  FNSMatchOptions         iOptions,
  129.                                  FNSMatchOptions *        oFailedMatchOptions) /* can be NULL */;
  130.  
  131. EXTERN_API_C( OSStatus )
  132. FNSReferenceFlattenedSize        (FNSFontReference         iReference,
  133.                                  ByteCount *            oFlattenedSize);
  134.  
  135. EXTERN_API_C( OSStatus )
  136. FNSReferenceFlatten                (FNSFontReference         iReference,
  137.                                  void *                    oFlatReference, /* can be NULL */
  138.                                  ByteCount *            oFlattenedSize) /* can be NULL */;
  139.  
  140. EXTERN_API_C( OSStatus )
  141. FNSReferenceUnflatten            (const void *            iFlatReference,
  142.                                  ByteCount                 iFlattenedSize,
  143.                                  FNSFontReference *        oReference);
  144.  
  145.  
  146. /* FontSync Profiles */
  147. enum {
  148.     kFNSCreatorDefault            = 0,
  149.     kFNSProfileFileType            = FOUR_CHAR_CODE('fnsp')
  150. };
  151.  
  152. typedef struct OpaqueFNSFontProfile*     FNSFontProfile;
  153. EXTERN_API_C( OSStatus )
  154. FNSProfileCreate                (const FSSpec *            iFile,
  155.                                  FourCharCode             iCreator,
  156.                                  ItemCount                 iEstNumRefs,
  157.                                  FNSObjectVersion         iDesiredVersion,
  158.                                  FNSFontProfile *        oProfile);
  159.  
  160. EXTERN_API_C( OSStatus )
  161. FNSProfileOpen                    (const FSSpec *            iFile,
  162.                                  Boolean                 iOpenForWrite,
  163.                                  FNSFontProfile *        oProfile);
  164.  
  165. EXTERN_API_C( OSStatus )
  166. FNSProfileGetVersion            (FNSFontProfile         iProfile,
  167.                                  FNSObjectVersion *        oVersion);
  168.  
  169. EXTERN_API_C( OSStatus )
  170. FNSProfileCompact                (FNSFontProfile         iProfile);
  171.  
  172. EXTERN_API_C( OSStatus )
  173. FNSProfileClose                    (FNSFontProfile         iProfile);
  174.  
  175. EXTERN_API_C( OSStatus )
  176. FNSProfileAddReference            (FNSFontProfile         iProfile,
  177.                                  FNSFontReference         iReference);
  178.  
  179. EXTERN_API_C( OSStatus )
  180. FNSProfileRemoveReference        (FNSFontProfile         iProfile,
  181.                                  FNSFontReference         iReference);
  182.  
  183. EXTERN_API_C( OSStatus )
  184. FNSProfileRemoveIndReference    (FNSFontProfile         iProfile,
  185.                                  UInt32                 iIndex);
  186.  
  187. EXTERN_API_C( OSStatus )
  188. FNSProfileClear                    (FNSFontProfile         iProfile);
  189.  
  190. EXTERN_API_C( OSStatus )
  191. FNSProfileCountReferences        (FNSFontProfile         iProfile,
  192.                                  ItemCount *            oCount);
  193.  
  194. EXTERN_API_C( OSStatus )
  195. FNSProfileGetIndReference        (FNSFontProfile         iProfile,
  196.                                  UInt32                 iWhichReference,
  197.                                  FNSFontReference *        oReference);
  198.  
  199. EXTERN_API_C( OSStatus )
  200. FNSProfileMatchReference        (FNSFontProfile         iProfile,
  201.                                  FNSFontReference         iReference,
  202.                                  FNSMatchOptions         iMatchOptions,
  203.                                  ItemCount                 iOutputSize,
  204.                                  UInt32                 oIndices[], /* can be NULL */
  205.                                  ItemCount *            oNumMatches) /* can be NULL */;
  206.  
  207.  
  208. /* Mapping to and from Font Objects */
  209. EXTERN_API_C( OSStatus )
  210. FNSReferenceCreate                (FMFont                 iFont,
  211.                                  FNSObjectVersion         iDesiredVersion,
  212.                                  FNSFontReference *        oReference);
  213.  
  214. EXTERN_API_C( OSStatus )
  215. FNSReferenceMatchFonts            (FNSFontReference         iReference,
  216.                                  FNSMatchOptions         iMatchOptions,
  217.                                  ItemCount                 iOutputSize,
  218.                                  FMFont                 oFonts[], /* can be NULL */
  219.                                  ItemCount *            oNumMatches) /* can be NULL */;
  220.  
  221.  
  222. /* Mapping to and from Font Families */
  223. EXTERN_API_C( OSStatus )
  224. FNSReferenceCreateFromFamily    (FMFontFamily             iFamily,
  225.                                  FMFontStyle             iStyle,
  226.                                  FNSObjectVersion         iDesiredVersion,
  227.                                  FNSFontReference *        oReference, /* can be NULL */
  228.                                  FMFontStyle *            oActualStyle) /* can be NULL */;
  229.  
  230. EXTERN_API_C( OSStatus )
  231. FNSReferenceMatchFamilies        (FNSFontReference         iReference,
  232.                                  FNSMatchOptions         iMatchOptions,
  233.                                  ItemCount                 iOutputSize,
  234.                                  FMFontFamilyInstance     oFonts[], /* can be NULL */
  235.                                  ItemCount *            oNumMatches) /* can be NULL */;
  236.  
  237.  
  238. /* UI Support */
  239. EXTERN_API_C( OSStatus )
  240. FNSReferenceGetFamilyInfo        (FNSFontReference         iReference,
  241.                                  Str255                 oFamilyName, /* can be NULL */
  242.                                  ScriptCode *            oFamilyNameScript, /* can be NULL */
  243.                                  FMFontStyle *            oActualStyle) /* can be NULL */;
  244.  
  245. EXTERN_API_C( OSStatus )
  246. FNSReferenceCountNames            (FNSFontReference         iReference,
  247.                                  ItemCount *            oNameCount);
  248.  
  249. EXTERN_API_C( OSStatus )
  250. FNSReferenceGetIndName            (FNSFontReference         iReference,
  251.                                  ItemCount                 iFontNameIndex,
  252.                                  ByteCount                 iMaximumNameLength,
  253.                                  Ptr                     oName, /* can be NULL */
  254.                                  ByteCount *            oActualNameLength, /* can be NULL */
  255.                                  FontNameCode *            oFontNameCode, /* can be NULL */
  256.                                  FontPlatformCode *        oFontNamePlatform, /* can be NULL */
  257.                                  FontScriptCode *        oFontNameScript, /* can be NULL */
  258.                                  FontLanguageCode *        oFontNameLanguage) /* can be NULL */;
  259.  
  260. EXTERN_API_C( OSStatus )
  261. FNSReferenceFindName            (FNSFontReference         iReference,
  262.                                  FontNameCode             iFontNameCode,
  263.                                  FontPlatformCode         iFontNamePlatform,
  264.                                  FontScriptCode         iFontNameScript,
  265.                                  FontLanguageCode         iFontNameLanguage,
  266.                                  ByteCount                 iMaximumNameLength,
  267.                                  Ptr                     oName, /* can be NULL */
  268.                                  ByteCount *            oActualNameLength, /* can be NULL */
  269.                                  ItemCount *            oFontNameIndex) /* can be NULL */;
  270.  
  271. /* Miscellany */
  272. EXTERN_API_C( Boolean )
  273. FNSEnabled                        (void);
  274.  
  275.  
  276. #if PRAGMA_STRUCT_ALIGN
  277.     #pragma options align=reset
  278. #elif PRAGMA_STRUCT_PACKPUSH
  279.     #pragma pack(pop)
  280. #elif PRAGMA_STRUCT_PACK
  281.     #pragma pack()
  282. #endif
  283.  
  284. #ifdef PRAGMA_IMPORT_OFF
  285. #pragma import off
  286. #elif PRAGMA_IMPORT
  287. #pragma import reset
  288. #endif
  289.  
  290. #ifdef __cplusplus
  291. }
  292. #endif
  293.  
  294. #endif /* __FONTSYNC__ */
  295.  
  296.